Skip to content

Add support for excluding specific containers in log analysis across multiple healthcheck runbooks#630

Merged
stewartshea merged 3 commits intorunwhen-contrib:mainfrom
stewartshea:fix/log-container-selection
Mar 25, 2026
Merged

Add support for excluding specific containers in log analysis across multiple healthcheck runbooks#630
stewartshea merged 3 commits intorunwhen-contrib:mainfrom
stewartshea:fix/log-container-selection

Conversation

@stewartshea
Copy link
Copy Markdown
Contributor

@stewartshea stewartshea commented Mar 25, 2026

  • Introduced a new variable ${EXCLUDED_CONTAINER_NAMES} to allow users to specify container names to exclude from log analysis.
  • Updated relevant log analysis functions in the DaemonSet, StatefulSet, Deployment, and Stacktrace healthcheck runbooks to utilize the new exclusion feature.
  • Enhanced the suite initialization to handle the conversion of the excluded container names into a list for processing.
  • Improved documentation to clarify the purpose and usage of the new exclusion functionality.

Note

Medium Risk
Modifies log scanning/anomaly analysis and multiple Kubernetes runbooks; incorrect exclusion handling or updated log-line normalization could hide real issues or change grouping/severity results.

Overview
Adds a new EXCLUDED_CONTAINER_NAMES input (parsed/trimmed into @{EXCLUDED_CONTAINERS}) and wires it through DaemonSet and StatefulSet log fetch/scan/anomaly tasks so selected sidecar containers can be omitted from analysis.

Enhances the Deployment runbook’s raw log collection with an optional CONTAINER_NAME; when unset it auto-selects the first non-excluded container before running kubectl logs.

Updates RW.K8sLog to actually skip excluded containers during scan/anomaly processing, improves log-line grouping normalization (more timestamp formats, IPs, floats, large IDs), and standardizes several warnings to logger.warn.

Written by Cursor Bugbot for commit 04965f7. This will update automatically on new commits. Configure here.

…multiple healthcheck runbooks

- Introduced a new variable `${EXCLUDED_CONTAINER_NAMES}` to allow users to specify container names to exclude from log analysis.
- Updated relevant log analysis functions in the DaemonSet, StatefulSet, Deployment, and Stacktrace healthcheck runbooks to utilize the new exclusion feature.
- Enhanced the suite initialization to handle the conversion of the excluded container names into a list for processing.
- Improved documentation to clarify the purpose and usage of the new exclusion functionality.
@stewartshea stewartshea requested a review from a team as a code owner March 25, 2026 14:24
Comment thread libraries/RW/CLI/CLI.py Outdated
…n` for consistency across CLI and K8s applications. This change enhances clarity in log messages and aligns with updated logging practices.
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread libraries/RW/K8sLog/k8s_log.py Outdated
- Adjusted regex to remove numbers with 5 or more digits, improving log clarity by preserving smaller byte counts and HTTP status codes.
- Enhanced comments for better understanding of the filtering logic.
@stewartshea stewartshea merged commit f5afb41 into runwhen-contrib:main Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant